package com.jt.www.admin.market.service;

import com.jt.www.domain.bo.CommissionBO;
import com.jt.www.domain.bo.MarketerUserRoleBO;
import com.jt.www.domain.po.CommissionPush;
import com.jt.www.domain.qo.CommissionPushQO;
import com.jt.www.domain.qo.CommissionQO;
import com.jt.www.model.reps.GenericListResponse;
import org.springframework.http.ResponseEntity;

/**
 * 佣金相关
 * Created by shaoyn on 2020/04/10.
 */

public interface CommissionService {

    /**
     * 保存佣金配置
     *
     * @param commissionBO
     * @return
     */
    int saveCommission(CommissionBO commissionBO) throws Exception;

    /**
     * 修改佣金配置
     *
     * @param commissionBO
     * @return
     */
    int updateCommission(CommissionBO commissionBO);

    /**
     * 查询佣金配置
     *
     * @return
     */
    ResponseEntity queryCommission(CommissionQO commissionQO);

    /**
     * 通过产品编号判断是否配置佣金
     *
     * @return
     */
    boolean isHasCommission(String productCode);

    /**
     * 保存佣金推送
     */
    int saveCommissionPush(CommissionPush commissionPush);

    /**
     * 创建投保单的佣金推送信息
     *
     * @param appCode 投保单号
     * @param logId   日志跟踪id
     * @return
     */
    CommissionPush createInsCommissionPush(String logId, String appCode);

    /**
     * 创建批单的佣金推送信息
     *
     * @param logId         日志跟踪标识
     * @param applyNo       批单申请号
     * @param endorsementNo 批单号
     * @param userCode
     * @return
     */
    CommissionPush createPolCommissionPush(String logId, String applyNo, String endorsementNo, String userCode);

    /**
     * 通过产品配置表id 查询佣金详情
     *
     * @param id
     * @return
     */
    ResponseEntity queryCommissionDetails(Long id);

    /**
     * 删除佣金配置
     *
     * @param id
     * @return
     */
    int deleteCommission(Long id);

    /**
     * 通过佣金推送相关，查询业绩列表及汇总
     *
     * @param commissionPushQO
     * @return
     */
    ResponseEntity queryCommissionPushListVO(CommissionPushQO commissionPushQO);

    /**
     * 通过佣金推送相关，查询业绩列表及汇总
     *
     * @param commissionPushQO
     * @return
     */
    ResponseEntity<GenericListResponse<CommissionPush>> downCommissionPushListVO(CommissionPushQO commissionPushQO);


    /**
     * 查询业绩列表-获得用户查询限制
     *
     * @param userCode
     * @return
     */
    MarketerUserRoleBO queryCommissionRole(String userCode) throws Exception;
}
